package day14;

import java.util.concurrent.ArrayBlockingQueue;

public class Cooker1 extends Thread{
    private ArrayBlockingQueue ab;
    Cooker1(ArrayBlockingQueue<String> ab) {
        this.ab=ab;
    }

    @Override
    public void run() {
        while (true){
            try {
                ab.put("汉堡包");
                System.out.println("厨师放入一个汉堡包");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
